home *** CD-ROM | disk | FTP | other *** search
/ The Trig Explorer / The Trig Explorer.iso / mac / Explorer / START.dxr / 00175_Draw line.ls < prev    next >
Encoding:
Text File  |  1998-07-22  |  696 b   |  29 lines

  1. on drawLine sprt, v1, h1, v2, h2
  2.   puppetSprite(sprt, 1)
  3.   if v1 = v2 then
  4.     set v1 to v1 + 2
  5.   end if
  6.   if h1 = h2 then
  7.     set h1 to h1 + 1
  8.   end if
  9.   if v1 > v2 then
  10.     if h1 > h2 then
  11.       spriteBox(sprt, h2, v2, h1, v1)
  12.       set the member of sprite sprt to member "slant down"
  13.     else
  14.       spriteBox(sprt, h1, v2, h2, v1)
  15.       set the member of sprite sprt to member "slant up"
  16.     end if
  17.   else
  18.     if h1 > h2 then
  19.       spriteBox(sprt, h2, v1, h1, v2)
  20.       set the member of sprite sprt to member "slant up"
  21.     else
  22.       spriteBox(sprt, h1, v1, h2, v2)
  23.       set the member of sprite sprt to member "slant down"
  24.     end if
  25.   end if
  26.   updateStage()
  27.   puppetSprite(psprt, 1)
  28. end
  29.